/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import java.io.Serializable;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

/**
 *
 * @author William
 */
@Entity
public class Reagent implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    @Column(unique = true, nullable = false)
    private String liqCode;
    private int cas;
    private String msds;
    @Column (unique = true)
    private String name;
    private String description;
    private List<String> restrictions;
    @OneToMany(cascade = CascadeType.ALL)
    private List<Location> location;
    @OneToOne(cascade =  CascadeType.ALL)
    private Security security;
    private String dateIn;
    private String dateExpiration;

    public Reagent() {
    }

    public Reagent(String liqCode, int cas, String msds, String name, String description, List<String> restrictions, List<Location> location, Security security, String dateIn, String dateExpiration) {
        this.liqCode = liqCode;
        this.cas = cas;
        this.msds = msds;
        this.name = name;
        this.description = description;
        this.restrictions = restrictions;
        this.location = location;
        this.security = security;
        this.dateIn = dateIn;
        this.dateExpiration = dateExpiration;
    }

    public String getLiqCode() {
        return liqCode;
    }

    public void setLiqCode(String liqCode) {
        this.liqCode = liqCode;
    }

    public int getCas() {
        return cas;
    }

    public void setCas(int cas) {
        this.cas = cas;
    }

    public String getMsds() {
        return msds;
    }

    public void setMsds(String msds) {
        this.msds = msds;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public List<String> getRestrictions() {
        return restrictions;
    }

    public void setRestrictions(List<String> restrictions) {
        this.restrictions = restrictions;
    }

    public List<Location> getLocation() {
        return location;
    }

    public void setLocation(List<Location> location) {
        this.location = location;
    }

    public Security getSecurity() {
        return security;
    }

    public void setSecurity(Security security) {
        this.security = security;
    }

    public String getDateIn() {
        return dateIn;
    }

    public void setDateIn(String dateIn) {
        this.dateIn = dateIn;
    }

    public String getDateExpiration() {
        return dateExpiration;
    }

    public void setDateExpiration(String dateExpiration) {
        this.dateExpiration = dateExpiration;
    }
    @Override
    public String toString (){
        final String reagent = "ID: "+id+" Nombre: " +name + " Descripción: " +description + " Codigo LIQ: " +liqCode+ " MSDS: " +msds+ " Fecha Ingreso: " +dateIn+ " Fecha Caducidad: " +dateExpiration;
        return reagent;
    }
  
}
